/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

.title-section {
    flex: 1;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

.subtitle {
    color: #7f8c8d;
    font-size: 16px;
}

/* 导航链接 */
.nav-links {
    display: flex;
    margin-bottom: 20px;
    gap: 15px;
}

.nav-links a {
    color: #3498db;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-links a:hover {
    border-bottom-color: #3498db;
}

.nav-links a.active {
    font-weight: 500;
    border-bottom-color: #3498db;
}

/* 标签页样式 */
.tab-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    background-color: #fff;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tab {
    padding: 15px 25px;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    flex: 1;
    text-align: center;
    border-bottom: 2px solid #eee;
}

.tab:hover {
    background-color: #f0f0f0;
}

.tab.active {
    background-color: #fff;
    border-bottom: 2px solid #3498db;
    color: #3498db;
}

.tab-content {
    background-color: white;
    border-radius: 0 0 8px 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 按钮样式 */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-default {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.btn-default:hover {
    background-color: #dfe6e9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* 搜索工具栏 */
.search-tools {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    padding-left: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background-color: white;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

/* 关联卡片样式 */
.relation-card {
    background-color: white;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.relation-header {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.relation-id {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.relation-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background-color: #f0f0f0;
    color: #666;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #e0e0e0;
}

.btn-view {
    background-color: #f8f9fa;
    color: #495057;
}

.btn-view:hover {
    background-color: #e9ecef;
}

.btn-edit {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.btn-edit:hover {
    background-color: #cfe2ff;
}

.btn-delete {
    background-color: #ffebee;
    color: #f44336;
}

.btn-delete:hover {
    background-color: #ffcdd2;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
}

.status-active {
    background-color: #e8f5e9;
    color: #4caf50;
}

.status-pending {
    background-color: #fff8e1;
    color: #ffc107;
}

/* 系统容器 */
.systems-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex-wrap: wrap;
}

.system-card {
    background-color: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    flex: 1;
    min-width: 300px;
}

.system-header {
    padding: 12px 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.system-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
}

.badge-construction {
    background-color: #e3f2fd;
    color: #2196f3;
}

.badge-heating {
    background-color: #fbe9e7;
    color: #ff5722;
}

.badge-gas {
    background-color: #e8f5e9;
    color: #4caf50;
}

.system-body {
    padding: 15px;
}

.address-field {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.field-label {
    color: #7f8c8d;
    flex: 0 0 80px;
}

.field-value {
    font-weight: 500;
    flex: 1;
}

.complete-address {
    margin-top: 15px;
    padding: 10px;
    background-color: #f5f7fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    color: #2c3e50;
    line-height: 1.5;
}

.relation-meta {
    padding: 10px 20px;
    border-top: 1px solid #eee;
    color: #95a5a6;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-item:hover {
    background-color: #f5f7fa;
}

.page-item.active {
    background-color: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

/* 未关联地址样式 */
.system-selector {
    display: flex;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.system-option {
    padding: 12px 20px;
    background-color: #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    min-width: 170px;
}

.system-option:hover {
    background-color: #dfe6e9;
}

.system-option.active {
    background-color: #3498db;
    color: white;
}

.unlinked-list {
    background-color: white;
    border-radius: 6px;
    overflow-x: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.unlinked-list table {
    width: 100%;
    border-collapse: collapse;
}

.unlinked-list th {
    padding: 12px 15px;
    text-align: left;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    color: #2c3e50;
}

.unlinked-list td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.unlinked-list tr:last-child td {
    border-bottom: none;
}

.unlinked-list tr:hover {
    background-color: #f9f9f9;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    font-weight: 500;
    margin: 0;
}

.close {
    font-size: 22px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.close:hover {
    color: #777;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.highlight-text {
    font-weight: 500;
    color: #3498db;
}

.warning-text {
    color: #e74c3c;
    margin-top: 8px;
}

/* 创建关联表单 */
.create-form {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-section {
    margin-bottom: 25px;
}

.section-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-desc {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.input-with-button {
    display: flex;
    position: relative;
}

.input-with-button .form-control {
    flex: 1;
    padding-right: 45px;
}

.input-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 45px;
    border: none;
    background: none;
    cursor: pointer;
    color: #3498db;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert i {
    font-size: 18px;
    margin-top: 2px;
}

.alert-info {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.search-results-container {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.search-results-header {
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    padding: 12px 15px;
    text-align: left;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.success-icon {
    text-align: center;
    margin: 20px 0;
    font-size: 48px;
    color: #2ecc71;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .systems-container {
        flex-direction: column;
    }
    
    .system-card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    .relation-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border-radius: 0;
    }
} 